<html>
<head>
  <meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=ISO-8859-1">
  <title>Contents.m</title>
<link rel="stylesheet" type="text/css" href="../../stpr.css">
</head>
<body>
<table  border=0 width="100%" cellpadding=0 cellspacing=0><tr valign="baseline">
<td valign="baseline" class="function"><b class="function">GREEDYAPPX</b>
<td valign="baseline" align="right" class="function"><a href="../../kernels/extraction/index.html" target="mdsdir"><img border = 0 src="../../up.gif"></a></table>
  <p><b>Kernel greedy data approximation.</b></p>
  <hr>
<div class='code'><code>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Synopsis:</span></span><br>
<span class=help>&nbsp;&nbsp;[Sel_inx,Alpha,Z,Kercnt,MsErrors,MaxErrors]&nbsp;=&nbsp;...</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;greedyappx(X,Ker,Arg,M,P,MsErr,Maxerr,Verb)&nbsp;</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Description:</span></span><br>
<span class=help>&nbsp;&nbsp;The&nbsp;input&nbsp;column&nbsp;vectors&nbsp;are&nbsp;assumed&nbsp;to&nbsp;be&nbsp;represented</span><br>
<span class=help>&nbsp;&nbsp;in&nbsp;a&nbsp;kernel&nbsp;feature&nbsp;space&nbsp;given&nbsp;by&nbsp;(ker,arg)&nbsp;(see&nbsp;help&nbsp;kernel).</span><br>
<span class=help>&nbsp;&nbsp;This&nbsp;function&nbsp;aims&nbsp;to&nbsp;select&nbsp;a&nbsp;subset&nbsp;X(:,Sel_inx)&nbsp;such</span><br>
<span class=help>&nbsp;&nbsp;that&nbsp;linear&nbsp;span&nbsp;of&nbsp;X(:,Sel_inx)&nbsp;in&nbsp;the&nbsp;feature&nbsp;space&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;approximates&nbsp;well&nbsp;the&nbsp;linear&nbsp;span&nbsp;of&nbsp;X&nbsp;in&nbsp;the&nbsp;feature&nbsp;space.</span><br>
<span class=help>&nbsp;&nbsp;The&nbsp;vectors&nbsp;are&nbsp;selected&nbsp;such&nbsp;that&nbsp;the&nbsp;mean&nbsp;square&nbsp;reconstruction</span><br>
<span class=help>&nbsp;&nbsp;error&nbsp;in&nbsp;the&nbsp;feature&nbsp;space&nbsp;(the&nbsp;same&nbsp;objective&nbsp;as&nbsp;has&nbsp;Kernel&nbsp;PCA)&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;is&nbsp;minimized&nbsp;by&nbsp;greedy&nbsp;algorithm.&nbsp;The&nbsp;algorithm&nbsp;selects&nbsp;vectors</span><br>
<span class=help>&nbsp;&nbsp;until&nbsp;on&nbsp;of&nbsp;the&nbsp;following&nbsp;stopping&nbsp;&nbsp;conditions&nbsp;is&nbsp;achieved:</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;number&nbsp;of&nbsp;vectors&nbsp;achieves&nbsp;m&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;maximal&nbsp;reconstruction&nbsp;error&nbsp;drops&nbsp;below&nbsp;maxerr&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;mean&nbsp;squared&nbsp;sum&nbsp;of&nbsp;reconstruction&nbsp;errors&nbsp;less&nbsp;than&nbsp;mserr.&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;The&nbsp;images&nbsp;of&nbsp;X(:,Inx_sel)&nbsp;in&nbsp;the&nbsp;features&nbsp;form&nbsp;a&nbsp;basis.</span><br>
<span class=help>&nbsp;&nbsp;The&nbsp;projection&nbsp;of&nbsp;input&nbsp;vector&nbsp;x&nbsp;into&nbsp;the&nbsp;basis&nbsp;is&nbsp;done&nbsp;by</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;z&nbsp;=&nbsp;Alpha*kernel(x,X(:,Sel_inx),Ker,Arg)</span><br>
<span class=help></span><br>
<span class=help>&nbsp;&nbsp;For&nbsp;more&nbsp;info&nbsp;refer&nbsp;to&nbsp;V.Franc:&nbsp;Optimization&nbsp;Algorithms&nbsp;for&nbsp;Kernel&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;Methods.&nbsp;Research&nbsp;report.&nbsp;CTU-CMP-2005-22.&nbsp;CTU&nbsp;FEL&nbsp;Prague.&nbsp;2005.</span><br>
<span class=help>&nbsp;&nbsp;ftp://cmp.felk.cvut.cz/pub/cmp/articles/franc/Franc-PhD.pdf&nbsp;.</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Input:</span></span><br>
<span class=help>&nbsp;&nbsp;X&nbsp;[Dim&nbsp;x&nbsp;Num_data]&nbsp;Input&nbsp;data.</span><br>
<span class=help>&nbsp;&nbsp;Ker&nbsp;[string]&nbsp;Kernel&nbsp;identifier.&nbsp;See&nbsp;help&nbsp;of&nbsp;KERNEL&nbsp;for&nbsp;more&nbsp;info.</span><br>
<span class=help>&nbsp;&nbsp;Arg&nbsp;[...]&nbsp;Argument&nbsp;of&nbsp;selected&nbsp;kernel.</span><br>
<span class=help>&nbsp;&nbsp;M&nbsp;[1x1]&nbsp;Maximal&nbsp;number&nbsp;of&nbsp;vector&nbsp;used&nbsp;for&nbsp;approximation.</span><br>
<span class=help>&nbsp;&nbsp;P&nbsp;[1x1]&nbsp;Depth&nbsp;of&nbsp;search&nbsp;for&nbsp;each&nbsp;basis&nbsp;vector.</span><br>
<span class=help>&nbsp;&nbsp;MsErr&nbsp;[1x1]&nbsp;Desired&nbsp;mean&nbsp;sum&nbsp;of&nbsp;squared&nbsp;reconstruction&nbsp;errors.</span><br>
<span class=help>&nbsp;&nbsp;MaxErr&nbsp;[1x1]&nbsp;Desired&nbsp;maximal&nbsp;reconstruction&nbsp;error.</span><br>
<span class=help>&nbsp;&nbsp;Verb&nbsp;[1x1]&nbsp;If&nbsp;1&nbsp;then&nbsp;infor&nbsp;about&nbsp;process&nbsp;is&nbsp;displayed.</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Output:</span></span><br>
<span class=help>&nbsp;&nbsp;Sel_inx&nbsp;[1&nbsp;x&nbsp;M]&nbsp;Indices&nbsp;of&nbsp;selected&nbsp;vector,&nbsp;i.e.,&nbsp;S&nbsp;=&nbsp;X(:,Sel_inx).</span><br>
<span class=help>&nbsp;&nbsp;Alpha&nbsp;[M&nbsp;x&nbsp;M]&nbsp;Defines&nbsp;projection&nbsp;into&nbsp;the&nbsp;found&nbsp;basis&nbsp;(see&nbsp;above).</span><br>
<span class=help>&nbsp;&nbsp;Z&nbsp;[M&nbsp;x&nbsp;Num_data]&nbsp;Training&nbsp;data&nbsp;projected&nbsp;into&nbsp;the&nbsp;found&nbsp;basis.</span><br>
<span class=help>&nbsp;&nbsp;Kercnt&nbsp;[1&nbsp;x&nbsp;1]&nbsp;Number&nbsp;of&nbsp;used&nbsp;kernel&nbsp;evaluations.</span><br>
<span class=help>&nbsp;&nbsp;MsErrors&nbsp;[1&nbsp;x&nbsp;M]&nbsp;Mean&nbsp;square&nbsp;reconstruction&nbsp;error&nbsp;wrt&nbsp;to&nbsp;selected&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;basis&nbsp;vectors.&nbsp;MsErr(end)&nbsp;is&nbsp;the&nbsp;resulting&nbsp;error.</span><br>
<span class=help>&nbsp;&nbsp;MaxErrors&nbsp;[1&nbsp;x&nbsp;M]&nbsp;Maximal&nbsp;squared&nbsp;reconstruction&nbsp;error&nbsp;(of&nbsp;the&nbsp;worst</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;input&nbsp;example)&nbsp;wrt.&nbsp;selcetd&nbsp;basis&nbsp;vectors.</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Example:</span></span><br>
<span class=help>&nbsp;&nbsp;type&nbsp;greedykpca</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=also_field>See also </span><span class=also></span><br>
<span class=help><span class=also>&nbsp;&nbsp;<a href = "../../kernels/extraction/greedykpca.html" target="mdsbody">GREEDYKPCA</a>.</span><br>
<span class=help></span><br>
</code></div>
  <hr>
  <b>Source:</b> <a href= "../../kernels/extraction/list/greedyappx.html">greedyappx.m</a>
  <p><b class="info_field">About: </b>  Statistical Pattern Recognition Toolbox<br>
 (C) 1999-2003, Written by Vojtech Franc and Vaclav Hlavac<br>
 <a href="http://www.cvut.cz">Czech Technical University Prague</a><br>
 <a href="http://www.feld.cvut.cz">Faculty of Electrical Engineering</a><br>
 <a href="http://cmp.felk.cvut.cz">Center for Machine Perception</a><br>

  <p><b class="info_field">Modifications: </b> <br>
 09-sep-2005, VF<br>
 12-feb-2005, VF, New help made<br>
 10-dec-2004, VF, tmp(find(Errors<=0)) = -inf; added to evoid num errors.<br>
 5-may-2004, VF<br>
 13-mar-2004, VF<br>
 10-mar-2004, VF<br>
 9-mar-2004, addopted from greedyappx<br>

</body>
</html>
